import { type PersonalCardDetailsResult, type UnitCardDetailsResult } from "@/api/card/types";
import { type IMemberItem, type UnitAddData } from "@/api/mine/types";
import { ApplyTypeEnum } from "@/enums/membershipEnum";
import { LikeTypeEnum } from "@/enums/publicModuleEnum";
import type { FunctionArgs } from "@vueuse/core";

/**
 * 名片详情
 */
export type cardDetails = {
  id?: number;
  scene?: number;
  isOneselfShare?: boolean,
  isControlCardIn?: boolean
};

/** 名片浏览记录 */
export type CardAccessRecord = {
  type: LikeTypeEnum;
  sourceId: number;
};

/** 编辑个人名片 */
export type EditPersonCard = {
  data: PersonalCardDetailsResult;
  callback: () => void;
};

/** 管理员编辑指定人个人名片 */
export type AdmminEditPersonCard = {
  cardId: number
  userId: number
  callback: () => void;
}

/** 编辑单位名片 */
export type EditBusinessCard = {
  id: number
  callback?: () => void;
};

/** 管理员编辑指定单位的名片 */
export type AdminEditBusinessCard = {
  id: number
  callback?: () => void;
}

/** 名片 - 选择展示成员 */
export type SelectShowMembers = {
  cocId?: number
  selectedMembers: IMemberItem[];
  submit: (members: IMemberItem[]) => void;
};

/** 编辑名下企业 */
export type EditAffiliatedCompanies = {
  item?: { id: number } & UnitAddData;
  success: FunctionArgs;
};

/** 管理员编辑指定人的单位 */
export type AdminEditAffiliatedCompanies = {
  userId: number
  item?: { id: number } & UnitAddData;
  success: FunctionArgs;
}

/** 编辑风采 */
export type ElegantDemeanourManage = {
  imgList: string[];
  applyType: ApplyTypeEnum;
  isEdit: boolean;
  showNum?: number;
  limit?: number;
  callback?: (imgList: string[]) => void;
};

/** 名片中优惠券列表 */
export type CardMemberCouponList = {
  leaderId: number;
};
